
#
#CFLAGS=-c 
#CC=g++
#
##ALL: main.o Player.o mysocket.o
#server: main.o Player.o mysocket.o
#	$(CC) -o server main.o Player.o mysocket.o
#	cp server ../
#main.o: main.cpp mysocket.h Player.h defs.h
#	$(CC) $(CFLAGS) main.cpp mysocket.h Player.h
#Player.o: Player.cpp Player.h
#	$(CC) $(CFLAGS) Player.cpp Player.h
#mysocket.o: mysocket.cpp mysocket.h
#	$(CC) $(CFLAGS) mysocket.cpp mysocket.h
#clean:
#	rm *.o *.gch

CC = g++
CC_FLAGS = -w

# File names
EXEC = server
SOURCES = $(wildcard *.cpp)
OBJECTS = $(SOURCES:.cpp=.o)

# Main target
$(EXEC): $(OBJECTS)
	$(CC) $(OBJECTS) -o $(EXEC)

# To obtain object files
%.o: %.cpp
	$(CC) -c $(CC_FLAGS) $< -o $@

# To remove generated files
clean:
	rm -f $(EXEC) $(OBJECTS)
